
/**
* 部队数据
*/
class ArmyInfo {
    /** 总血量 */
    public bloodTotal: number = 100;
    public bloodTotalTmp: number = this.bloodTotal;
    /** 血量 */
    public bloodVolume: number = this.bloodTotal;
    /** 皮肤 */
    public skinNmae: string = "army";
    /** 生存状态 */
    public lifeType: string = "";
    /** 方向 */
    public direction: number = 0;
    /** 速度 */
    public speed: number = 1;
    public speedTmp: number = this.speed;
    /** 移动 */
    public ismove: boolean = false;
    /** 可移动 */
    public canMove: boolean = true;
    /** 加载完 */
    public isloaded: boolean = false;
    /** 移动 */
    public isattack: boolean = false;
    /** 上次攻击时间 */
    public prehitTime: number = 0;
    /** 上次攻击动画时间 */
    public attackTime: number = 0;
    /** 攻击延迟 */
    public hitDelayTime: number = 120;
    /** 伤害 */
    public hitBlood: number = 20;
    public hitBloodTmp: number = this.hitBlood;
    /** 攻击距离 */
    public hitDistance: number = 50;
    /** 是否被冰冻 */
    public iceCount: number = 0;
    /** 是否暂停游戏 */
    public createCan: boolean = false;
    /** 金币 */
    public gold: number = 200;
    public goldTmp: number = this.gold;
    
    /** level */
    private _level: number = 1;
    public set level(value: number) {
        this._level = value;

        this.bloodTotal = Math.round(this.bloodTotalTmp * Math.pow(1.6,this._level));
        this.hitBlood = Math.round(this.hitBloodTmp * Math.pow(1.6,this._level));
        this.gold = Math.round(this.goldTmp * Math.pow(1.1,this._level));

    }
    public get level(): number {
        return this._level;
    }
    public backups() {
		this.bloodTotalTmp = this.bloodTotal;
        this.speedTmp = this.speed;
        this.hitBloodTmp = this.hitBlood;
        this.goldTmp = this.gold;
    }
}